package com.lancoo.cvas.mapper;

import com.lancoo.cvas.config.MybatisRedisCache;
import com.lancoo.cvas.entity.PlanTeaching;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.cvas.entity.Student;
import com.lancoo.cvas.pojo.dto.GradeCourseDto;
import com.lancoo.cvas.pojo.vo.TeachingClassCourseDto;
import org.apache.ibatis.annotations.CacheNamespace;

import java.util.Collection;
import java.util.List;

/**
 * 教务获取教学计划，相当于专业版本
 * 
 * @author liufeng
 * @email 1037383243@qq.com
 * @date 2023-12-04 11:54:00
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface PlanTeachingMapper extends BaseMapper<PlanTeaching> {

    int addBatch(List<PlanTeaching> insertList);

    /**
     *根据教学计划 年级 专业  获取课程
     * @param taskId
     * @param courseTypeId
     * @param courseNature
     * @param credit
     * @param keyWord
     * @param baseMajorId
     * @param gradeId
     * @return
     */
    List<TeachingClassCourseDto> getCourseByPlan(Integer taskId, String courseTypeId, Integer courseNature, Double credit, String keyWord,  String baseMajorId, String gradeId);


    /**
     * 获取重修学生 课程
     * @param taskId
     * @param schoolId
     * @param term
     * @param courseTypeId
     * @param courseNature
     * @param credit
     * @param keyWord
     * @param baseStudentId
     * @param studyNature
     * @return
     */
    List<TeachingClassCourseDto> getCourseRetake(Integer taskId, String schoolId, String term, String courseTypeId, Integer courseNature, Double credit, String keyWord, String baseStudentId, Integer studyNature);

    /**
     * 根据课程id获取 含有该课程的教学计划
     * @param courseId
     * @param studyNature
     * @param campusId
     * @return
     */
    List<PlanTeaching> getPlanTeachingByCourseId(Long courseId, Integer studyNature, String campusId);

    /**
     * 根据环节id获取 含有该环节的教学计划
     * @param courseId
     * @param studyNature
     * @param campusId
     * @return
     */
    List<PlanTeaching> getPlanTeachingBySegmentId(Long courseId, Integer studyNature, String campusId);

    /**
     * 根据教学计划id列表获取学生
     * @param taskId
     * @param baseTeachingPlanIds
     * @return
     */
    List<Student> getStudentByPlanId(Integer taskId, List<String> baseTeachingPlanIds);

    List<GradeCourseDto> getAllGradeAndCourse(Integer taskId, int deleted);

    List<PlanTeaching> selectPlanTeachingList(Integer taskId, int deleted);
}
